package learn.emp02.ex30;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        char inputChar = scanner.next().charAt(0);
        char lowerChar = Character.toLowerCase(inputChar);
        int result;
        if (lowerChar >= 'a' && lowerChar <= 'c') {
            result = 2;
        } else if (lowerChar >= 'd' && lowerChar <= 'f') {
            result = 3;
        } else if (lowerChar >= 'g' && lowerChar <= 'i') {
            result = 4;
        } else if (lowerChar >= 'j' && lowerChar <= 'l') {
            result = 5;
        } else if (lowerChar >= 'm' && lowerChar <= 'o') {
            result = 6;
        } else if (lowerChar >= 'p' && lowerChar <= 's') {
            result = 7;
        } else if (lowerChar >= 't' && lowerChar <= 'v') {
            result = 8;
        } else if (lowerChar >= 'w' && lowerChar <= 'z') {
            result = 9;
        } else {
            System.out.println(inputChar + " is an invalid input");
            scanner.close();
            return;
        }
        System.out.println(result);
        scanner.close();
    }
}